 <template>
 	<view :style="skin" class="lease">
 		<block v-if="showPage">
 			<view class="memberInfo" v-if="selectUser.nickname" @click="searchUser">
 				<view class="memberLeft">
					<!-- {{moneyObj.offMoney}} -->
 					<u--image shape="circle" :src="selectUser.avatar" width="75px" height="75px"></u--image>
 					<!-- <text>{{$t('lease.MemberLevel')}}:{{selectUser.grade}}</text> -->
 				</view>
 				<view class="memberRight">
 					<view class="memberRight-content">
 						<text class="contentKey">{{$t('lease.name')}}:</text>
 						<text class="content-info">{{selectUser.nickname}}</text>
 					</view>
 					<view class="memberRight-content">
 						<text class="contentKey">{{$t('lease.productID')}}:</text>
 						<text class="content-info">{{selectUser.customerAccount}}</text>
 					</view>
 					<view class="memberRight-content">
 						<text class="contentKey">{{$t('lease.phone')}}:</text>
 						<text class="content-info">{{selectUser.phone}}</text>
 					</view>
 					<view class="memberRight-content">
 						<text class="contentKey">{{$t('lease.rentalTimes')}}:</text>
 						<text class="content-info">{{selectUser.rentNum}}</text>
 					</view>
 					<view class="memberRight-content">
 						<text class="contentKey">{{$t('lease.lastRental')}}:</text>
 						<text class="content-info">{{selectUser.lastTimeRent}}</text>
 					</view>
 				</view>

 			</view>
 			<view class="memberInfo flex-c-SE-c" v-else>
 				<view class="btnBox">
 					<u-button color="var(--subjectColor)" shape="circle"
 						@click="searchUser">{{$t('lease.clickMember')}}</u-button>
 				</view>
 			</view>
 			<view class="deviceInfo">
 				<view class="deviceTitle">
 					<view class="iconBox">
 						<text class="iconfont icon-a-mingchengarrow_left" @click="lastDevice"></text>
 					</view>
 					<view class="title">
 						{{$t('lease.recomProduct')}}
 					</view>
 					<view class="iconBox">
 						<text class="iconfont icon-a-mingchengarrow_right" @click="nextDevice"></text>
 					</view>
 				</view>
				<!-- <u-input v-model="macInp"></u-input> -->
 				<view class="deviceMain">
 					<view class="deviceLeft">
 						<u--image :src="'https://test24.giraffepowa.com'+actionDeviceType.photo" width="75px"
 							height="75px"></u--image>
 						<text>{{actionDeviceType.productModel}}</text>
 						<!-- <text class="iconfont icon-a-mingchengarrow_down" @click="sheetTypeShow = true"></text> -->
 					</view>
 					<!-- 选择产品 -->
 					<view class="deviceRight" v-if="status == 1">
 						<view class="deviceRight-content">
 							<text class="deviceRightT">{{$t('lease.productID')}}:</text>
 							<!-- inputDeviceId actionDevice.deviceId -->
 							<u-input :placeholder="$t('lease.pleEnter')" disabled border='bottom' v-model="inputDeviceId">
 								<template slot="suffix">
 									<image @click="viewDevice" style="width: 24px;height: 24px;" src="../../static/images/idSearch.png"
 										mode=""></image>
 								</template>
 							</u-input>

 						</view>
 						<view class="deviceRight-content">
 							<text class="deviceRightT">{{$t('lease.battery')}}:</text>
 							<text class="content-info">{{battery}}%</text>
 						</view>
 						<!-- <view class="deviceRight-content">
							<text class="deviceRightT">优惠券号码:</text>
							<view class="content-info">

								<u-input placeholder="请输入" border="bottom" v-model="value">
									<template slot="suffix">
										<text class="iconContent">使用</text>
									</template>
								</u-input>
							</view>
						</view> -->
 						<view class="deviceRight-content">
 							<text class="deviceRightT">{{$t('lease.rentalDay')}}:</text>
 							<view class="content-info flex-c-SB" style="display: flex;">

 								<view class="dayBtn" @click="handleDay('reduce')">
 									-
 								</view>
 								<view class="dayCont">
 									{{leaseDay}}
 								</view>
 								<view class="dayBtn" @click="handleDay('add')">
 									+
 								</view>
 							</view>

 						</view>
 						<view class="deviceRight-content" @click="showPage = false">
 							<text class="deviceRightT">{{$t('lease.currentPrice')}}:</text>
 							<text class="content-info">
 								{{ moneyTran(leasePrice) == 'NaN'?'--':moneyTran(leasePrice)}}{{$t('lease.unit')}}
 								<image class="iconContent" style="width: 24px;height: 24px;" src="../../static/images/priceIcon.png"
 									mode=""></image>
 							</text>
 						</view>
 					</view>

 					<!-- 解锁中 -->
 					<view class="deviceRight" v-else-if="status != 1">
 						<view class="deviceRight-content">
 							<text class="deviceRightT">{{$t('lease.productID')}}:</text>
 							<text class="content-info">
 								{{inputDeviceId}}
 								<!-- <text class="iconfont icon-a-mingchengmenu-2 iconContent"></text> -->
 							</text>
 						</view>

 						<view class="deviceRight-content" v-for="(item,index) in stepList" :key="index">
 							<text class="deviceRightT">{{item.name}}:</text>
 							<view class="content-info flex-c-SB">
 								<text class="loadingBox">... ... ...</text>
 								<view class="iconContent">
 									<u-icon v-if="item.statusType == 'success'" name="checkmark-circle" color="#81B337"
 										size="24"></u-icon>

 									<u-loading-icon size="24" v-else-if="item.statusType == 'loading'"></u-loading-icon>

 									<text style="color: red;" v-else-if="item.statusType == 'error'"
 										class="iconfont icon-a-mingchengclose-circle-line iconContent"></text>
 								</view>

 							</view>
 						</view>

 					</view>
 				</view>

 				<!-- 确定开锁 -->
 				<view class="confir" v-if="status == 1">
 					<view class="conBtn1">
 						<u-button color="var(--subjectColor)" :disabled="!isUnlock" @click="isBlueOpne">

 							<text class="btnText">{{$t('lease.searchDevice')}}</text>
 						</u-button>
 					</view>
 					<view class="conBtn1">
 						<u-button color="var(--subjectColor)" :disabled="isUnlock" @click="confirmLock">
 							<text class="btnText">{{$t('lease.confirmUnlock')}}</text>
 						</u-button>
 					</view>

 				</view>

 				<view class="confir" v-if="status == 2">

 					<u-button color="var(--subjectColor)" disabled>
 						<text style="font-size: 12px;">
 							{{$t('lease.unlocking')}}
 						</text>

 					</u-button>
 				</view>

 				<view class="confir" v-if="status == 3">
 					<u-button type="success" @click="unlockSu">
 						<text style="font-size: 12px;">{{$t('lease.UnlockSuccessful')}}</text>
 					</u-button>
 					<u-button customStyle="margin-left: 10px;" type="primary" @click="againpass">
 						<text style="font-size: 12px;">{{$t('lease.ResendKeycode')}}</text>
 					</u-button>
 					<!-- 					<u-button customStyle="margin-left: 10px;" @click="changeDevice">切换产品
					</u-button> -->
 				</view>

 				<view class="confir" v-if="status == 4">
 					<u-button type="success" @click="nextAgein">
 						<text style="font-size: 12px;">
 							{{$t('lease.rentOneMore')}}
 						</text>

 					</u-button>
 					<u-button customStyle="margin-left: 10px;" color="var(--subjectColor)" @click="nextUser">
 						<text style="font-size: 12px;">
 							{{$t('lease.nextUser')}}
 						</text>

 					</u-button>
 				</view>

 			</view>

 		</block>

 		<block v-else>
 			<priceList @goBack="goBack" :productModel="actionDeviceType.productModel" />
 		</block>

 		<!-- 设备详情 -->
 		<u-action-sheet @select="selectDevice" @close="sheetShow = false" :cancelText="$t('me.Prompt')"
 			:actions="deviceList" :show="sheetShow"></u-action-sheet>

 		<DialogPopup hideCancel @btnConfirm="handleTips" :show="showTips" :title="$t('me.Prompt')" handleType="text"
 			:textInfo="$t('lease.noResponse')">
 		</DialogPopup>

 		<u-modal showCancelButton :show="modelShow" :content='content' @confirm="modelConfirm" @cancel="modelCancel"
 			confirmText="confirm" cancelText="cancel"></u-modal>

 	</view>
 </template>

 <script>
 	import {
 		mapState
 	} from 'vuex'

 	import priceList from './priceList.vue'

 	import {
 		getDeviceType,
 		addDeviceType
 	} from '@/utils/sql/sqlDeviceType.js'
 	import {
 		getDeviceTypeToId,
 		addDevice,
 	} from '@/utils/sql/sqlDevice.js'
 	import toast from 'uview-ui/libs/config/props/toast';
 	import DialogPopup from '@/components/DialogPopup.vue'
 	import {
 		addLease,
 		crateLease,
 		getlease4
 	} from '@/utils/sql/sqllease.js'
 	import {
 		addUser
 	} from '@/utils/sql/sqlUser.js'
 	import {
 		addOrUpdateInCome
 	} from '@/utils/sql/sqlInComeDtoList.js'
 	import {
 		addOrUpdateOffMoney
 	} from '@/utils/sql/sqloffLineDtoList.js'
 	import {
 		addOrUpdateTrunOver
 	} from '@/utils/sql/sqlTrunoverDtoList.js'
 	import {
 		deepClone,
 		formatDateTime,
 		pidToMAC,
 		formatHexString,
 		dataTran,
 		mulDataDevice,
 		repetitionDataMac,
 		repetitionData,
 		createNonceStr,
 		getNewYMDSql,
 		getNewYMD,
 		getNewYMDHMS,
 		addColonEveryTwoChars,
 		getrentCode
 	} from '@/utils/index.js'
 	import {
 		getPriceTypeToId
 	} from '@/utils/sql/sqlPrice.js'
 	import {
 		lockPass
 	} from '@/utils/keeploq.js'
 	import {
 		leaseDeductOnline
 	} from '@/api/balance.js'
 	import {
 		addPassConfig
 	} from '@/utils/sql/sqlPassConfig.js'
 	import {
 		adressAuthority
 	} from '@/utils/jurisdiction.js'
	import {
		getMoneyInfo,
	} from '@/utils/sql/sqlMoney.js'
 	export default {
 		props: {
 			selectDeviceInfo: {
 				type: Object,
 				default: {},
 			},
 		},
 		data() {
 			return {
				moneyObj:{},
 				content: '',
 				modelShow: false,
 				battery: '--', //设备电量，等设备上报数据
 				priceModel: {},
 				showTips: false,
 				inputDeviceId: '', //用户输入的产品ID
 				value: '',
 				showPage: true,
 				src: '',
 				leaseDay: null,
 				leaseIndex: 0, //leaseDay 对应的下标
 				leasePrice: null,
 				status: 1, //1 正在选择产品 2解锁中 3 解锁失败 4 解锁成功
 				sheetShow: false,
 				deviceList: [],
 				deviceTypeList: [],
 				stepList: [{
 						name: this.$t('lease.deduction'),
 						statusType: 'loading'
 					},
 					{
 						name: this.$t('lease.passSent'),
 						statusType: 'loading'
 					},
 					{
 						name: this.$t('lease.passwordCal'),
 						statusType: 'loading'
 					},

 					{
 						name: this.$t('lease.informationWritten'),
 						statusType: 'loading'
 					},


 				],

 				actionDeviceType: {},
 				actionDevice: {},

 				ble: uni.requireNativePlugin('ble'),
 				time: null,

 				mmObj: '',

 				deviceInfoObj: '',

 				commission: '10', //提成
 				tipsPass: null,
 				rentInitProperty: null,
 				agencySecurityDeposit: 0,
 				ageinNum: 0,
 				timePBle: null,

 				passRentCode: '', //流水产生的code
				
				// macInp:'00:00:0E:48:68:4F',
 			};
 		},
 		computed: {
 			...mapState({
 				skin: state => state.theme.skin,
 				selectUser: state => state.home.selectUser,
 				isNoNetWork: state => state.home.isNoNetWork,
				
 			}),
 			isUnlock() {
 				if (JSON.stringify(this.selectUser) != '{}' && JSON.stringify(this.actionDevice) != '{}' && this
 					.deviceInfoObj != '') {
 					return false
 				} else {
 					return true
 				}

 			}

 		},
 		async mounted() {
 			let that = this
 			this.mmObj = ''
 			this.deviceInfoObj = ''
 			this.counterStatus = ''
 			this.battery = '--'

 			clearInterval(this.time)
 			clearTimeout(this.tipsTime)

 			this.stepList = [{
 					name: this.$t('lease.deduction'),
 					statusType: 'loading'
 				},
 				{
 					name: this.$t('lease.passSent'),
 					statusType: 'loading'
 				},
 				{
 					name: this.$t('lease.passwordCal'),
 					statusType: 'loading'
 				},

 				{
 					name: this.$t('lease.informationWritten'),
 					statusType: 'loading'
 				},
 			]
 			this.ble.init()

 			setTimeout(async () => {
 				await that.getDeviceTypeList()
 				that.actionDeviceType = that.deviceTypeList[0]
 				await that.getDevice(that.deviceTypeList[0].productModel, 2)
 				await that.getPrice(that.deviceTypeList[0].productModel)
				await that.getUserMoney();
 			}, 500)

 			uni.$on('changeSwitch', function(data) {
 				console.log('切换SwitchTab');

 				that.mmObj = ''
 				that.deviceInfoObj = ''
 				that.counterStatus = ''
 				that.inputDeviceId = ''
 				that.battery = '--'
 				that.status = 1
 				clearInterval(that.time)
 				clearTimeout(that.tipsTime)
			
 				that.stepList = [{
 						name: that.$t('lease.deduction'),
 						statusType: 'loading'
 					},
 					{
 						name: that.$t('lease.passSent'),
 						statusType: 'loading'
 					},
 					{
 						name: this.$t('lease.passwordCal'),
 						statusType: 'loading'
 					},

 					{
 						name: this.$t('lease.informationWritten'),
 						statusType: 'loading'
 					},
 				]
 				that.ble.init();
 				setTimeout(async () => {
 					await that.getDeviceTypeList()
 					that.actionDeviceType = that.deviceTypeList[0]
 					await that.getDevice(that.deviceTypeList[0].productModel, 2)
 					await that.getPrice(that.deviceTypeList[0].productModel)
					await that.getUserMoney();
 				}, 500)

 			})
 		},
 		onShow() {
 			this.status = 1
 			this.mmObj = ''
 			this.deviceInfoObj = ''
 			this.counterStatus = ''
 			this.battery = '--'
 			clearInterval(this.time)
 			clearTimeout(this.tipsTime)
 		},
 		beforeDestroy() {
 			this.mmObj = ''
 			this.deviceInfoObj = ''
 			this.counterStatus = ''
 			this.battery = '--'
 			clearTimeout(this.tipsTime)
 			clearInterval(this.time)

 		},
 		onUnload() {
 			this.mmObj = ''
 			this.deviceInfoObj = ''
 			this.counterStatus = ''
 			this.battery = '--'
 			clearInterval(this.time)
 			clearTimeout(this.tipsTime)
 		},
 		onHide() {
 			this.mmObj = ''
 			this.deviceInfoObj = ''
 			this.counterStatus = ''
 			this.battery = '--'
 			clearInterval(this.time)
 			clearTimeout(this.tipsTime)
 		},

 		methods: {
 			moneyTran(m) {
 				return (m / 100).toFixed(2)
 			},
			getUserMoney() {
				getMoneyInfo().then(res => {
					this.moneyObj = res.data[0]
				})
			},
 			handleTips() {

 				this.showTips = false
 				this.status = 1


 			},
 			modelCancel() {
 				this.modelShow = false
 				this.content = ''
 			},
 			modelConfirm() {
 				this.modelShow = false
 				this.content = ''
 				this.userWrite();
 				let recodePass = {
 					rentCode: this.passRentCode,
 					unlockStatus: 0,
 				}
 				addPassConfig(recodePass)
 			},
 			viewDevice() {
 				if (this.deviceList.length > 0) {
 					this.sheetShow = true
 				}

 			},
 			handleDay(type) {
 				let indexArr = Object.keys(this.priceModel)
 				if (type == 'reduce') {
 					if (this.leaseIndex > 0) {
 						let index = this.leaseIndex - 1
 						this.leaseDay = indexArr[index]
 						this.leasePrice = this.priceModel[this.leaseDay]
 						this.leaseIndex = index
 					}

 				} else {
 					if (this.leaseIndex < Object.keys(this.priceModel).length - 1) {
 						let index = this.leaseIndex + 1
 						this.leaseDay = indexArr[index]

 						this.leasePrice = this.priceModel[this.leaseDay]
 						this.leaseIndex = index
 					}
 				}
 			},
 			unlockSu() {

 				clearInterval(this.timePBle);
 				clearTimeout(this.tipsTime)
 				clearInterval(this.time)
 				this.stopSend()
 				this.mmObj = ''
 				this.deviceInfoObj = ''
 				this.counterStatus = ''
 				this.battery = '--'


 				this.modelShow = true
 				this.content = this.actionDevice.productId + 'Unlocking succeeded?'
 			},
 			againpass() {
 				let that = this
 				this.ageinNum++;
 				console.log(this.ageinNum);
 				if (this.ageinNum >= 5) {

 					// 密码解锁失败，返回最初状态
 					that.status = 1

 					that.mmObj = ''
 					that.stopSend()
 					clearInterval(that.timePBle)

 					that.stepList.map(item => {
 						return item.statusType = 'loading'
 					})
 					let recodePass = {
 						rentCode: that.passRentCode,
 						unlockStatus: 1,
 					}
 					addPassConfig(recodePass)
 					// 解锁失败 返还金额
 					// that.alseMoney()

 					uni.showToast({
 						title: this.$t('lease.unlockFailed'),
 						icon: 'none',
 						duration: 3000
 					});
 					return false
 				}


 				this.status = 2;
 				this.mmObj = ''
 				this.passRentCode = "RT" + getNewYMDSql() + createNonceStr();
 				this.sendPass('last')
 				clearInterval(that.timePBle);
 				this.timePass();
 				this.getBLEPass();

 			},
 			// 下一个用户
 			nextUser() {
 				this.stepList.map(item => {
 					return item.statusType = 'loading'
 				})
 				this.status = 1
 				uni.navigateTo({
 					url: '/pages/home/searchUser/searchUser'
 				})
 			},
 			// 在租一个
 			nextAgein() {
 				this.status = 1
 				this.stepList.map(item => {
 					return item.statusType = 'loading'
 				})
 				this.getDevice(this.actionDeviceType.productModel, '1')
 			},

 			searchUser() {
 				uni.navigateTo({
 					url: '/pages/home/searchUser/searchUser'
 				})
 			},
 			lastDevice() {
 				if (this.status != 1) {
 					uni.showToast({
 						title: 'This product has been identified and cannot be switched',
 						icon: 'none'
 					});
 					return false
 				}
 				let index = this.deviceTypeList.findIndex(item => {
 					return item.productModel == this.actionDeviceType.productModel
 				})

 				if (index == 0) {
 					// uni.showToast({
 					// 	title: this.$t('lease.firstDevice'),
 					// 	icon: 'none'
 					// });
 				} else {
 					this.actionDeviceType = this.deviceTypeList[index - 1]

 					this.getDevice(this.actionDeviceType.productModel, '1')
 					this.getPrice(this.actionDeviceType.productModel)
 					this.reset()
 				}
 			},
 			nextDevice() {
 				if (this.status != 1) {
 					// uni.showToast({
 					// 	title: this.$t('lease.noSwitched'),
 					// 	icon: 'none'
 					// });
 					return false
 				}
 				let index = this.deviceTypeList.findIndex(item => {
 					return item.productModel == this.actionDeviceType.productModel
 				})
 				let len = this.deviceTypeList.length - 1
 				if (index == len) {
 					// uni.showToast({
 					// 	title: this.$t('lease.lastDevice'),
 					// 	icon: 'none'
 					// });
 				} else {
 					this.actionDeviceType = this.deviceTypeList[index + 1]

 					this.getDevice(this.actionDeviceType.productModel, '1')
 					this.getPrice(this.actionDeviceType.productModel)
 					this.reset()
 				}
 			},

 			selectDevice(item) {
 				this.actionDevice = item
 				this.inputDeviceId = this.actionDevice.productId

 				this.reset()
 			},
 			async getDeviceTypeList() {
 				let res = await getDeviceType()
 				if (res.code == 0) {
 					this.deviceTypeList = res.data

 				}
 			},
 			async getPrice(productModel) {
 				let res = await getPriceTypeToId(productModel)
 				if (res.code == 0 && res.data.length > 0) {
 					let priceModel = JSON.parse(res.data[0].priceModel)
 					let keys = Object.keys(priceModel)
 					let values = Object.values(priceModel)
 					this.leaseDay = keys[0]
 					this.leasePrice = values[0]
 					this.priceModel = priceModel
 					this.agencySecurityDeposit = res.data[0].agencySecurityDeposit

 					if (!res.data[0].commission) {
 						this.commission = '10'
 					} else {
 						let comm = res.data[0].commission
 						let commission = '10'
 						let index = comm.indexOf('%');
 						if (index != -1) {
 							commission = comm.slice(0, -1)
 						}
 						this.commission = commission
 					}

 				} else {
 					this.priceModel = {}
 					this.leaseDay = '--'
 					this.leasePrice = '--'
 					this.commission = '10'
 					this.agencySecurityDeposit = 0
 					// uni.showToast({
 					// 	title: '当前品类暂无价格',
 					// 	icon:'none'
 					// });
 				}

 			},
 			async getDevice(productModel, type) {
 				let res = await getDeviceTypeToId(productModel)
 				if (res.code == 0) {
 					if (res.data.length > 0) {
 						res.data.map(item => {
 							return item.name = item.productId, item.battery = JSON.parse(item.productProperty).battery
 						})
 					}

 					this.deviceList = res.data.filter(item => {
 						return item.stockStatus == 1
 					})
 					if (this.deviceList.length == 0) {
 						// uni.showToast({
 						// 	title: this.$t('lease.noDevice'),
 						// 	icon: 'none'
 						// });
 						if (type == 1) {
 							this.inputDeviceId = ''
 						}
 						return false
 					}
 					this.actionDevice = this.deviceList[0]
 					this.inputDeviceId = this.actionDevice.productId
 				}
 			},
 			timePopup() {
 				clearTimeout(this.tipsTime)
 				let that = this
 				this.tipsTime = setTimeout(() => {

 					this.mmObj = ''
 					this.deviceInfoObj = ''
 					this.counterStatus = ''
 					this.battery = '--'
 					uni.hideLoading()


 					that.showTips = true
 					that.stopSend()

 					clearInterval(that.time)
 				}, 5000)
 			},
 			timePass() { //发送3秒后，没收到设备发出的消息
 				clearTimeout(this.tipsPass);
 				let that = this
 				this.tipsPass = setTimeout(() => {
 					that.status = 3
 				}, 3000)
 			},
 			confirmLock() {
 				this.passRentCode = "RT" + getNewYMDSql() + createNonceStr();
 				if (this.counterStatus = 'next') { //计数器小于等于本地才扣款
 					this.leaseHold()
 					this.sendPass('next')
 				} else if (this.counterStatus == 'last') {
 					this.sendPass('last')
 				}
 				this.timePass();
 				this.deviceInfoObj = ''
 				this.getBLEPass();
 			},
 			// 获取返回的密码的蓝牙命令数据
 			getBLEPass() {
 				// 接收数据
 				this.timePBle = setInterval(() => {
 					let that = this
 					that.ble.getBackData(function(res) {
 						console.log('倒计时');

 						if (res.data.length > 0) {
 							console.log(res.data);
 							let bleDate = res.data[0]
 							let orderNum = parseInt(bleDate.msg.slice(4, 6), 16);
 							console.log(orderNum);

 							if (orderNum == 201) {
 								let data = dataTran(res.data[0].msg) //处理设备返回的信息
 								that.ble.littleEndianStringToInt(data.littleNum, function(res) {
 									data.num = res.data
 									that.stopSend()

 									if (data.num == 0 || data.num == 1) { //解锁成功
 										if (that.mmObj == '') {
 											that.mmObj = data
 											uni.showToast({
 												title: bleDate.msg,
 												icon: 'none'
 											})
 											clearTimeout(that.tipsTime);
 											clearTimeout(that.tipsPass);

 											// 修改状态
 											that.stepList.map((item, index) => {
 												if (index == 2 || index == 0 || index == 1) {
 													return item.statusType = 'success'
 												}
 											})

 											// 设备端获取的密码计数器小于APP计数器 不扣款
 											// 写入用户数据
 											that.userWrite()
 											let recodePass = {
 												rentCode: that.passRentCode,
 												unlockStatus: 0,
 											}
 											addPassConfig(recodePass)

 											clearInterval(that.timePBle)
 										}
 									} else {
 										// 密码解锁失败，返回最初状态
 										that.status = 1

 										that.mmObj = ''
 										that.stopSend()
 										clearInterval(that.timePBle)

 										that.stepList.map(item => {
 											return item.statusType = 'loading'
 										})
 										let recodePass = {
 											rentCode: that.passRentCode,
 											unlockStatus: 1,
 										}
 										addPassConfig(recodePass)
 										// 解锁失败 返还金额
 										// that.alseMoney()

 										uni.showToast({
 											title: this.$t('lease.unlockFailed'),
 											icon: 'none',
 											duration: 3000
 										});
 									}

 								})
 							}
 						}
 					})
 				}, 2000)
 			},
 			isBlueOpne() {
 				let that = this
 				this.ble.isUiThreadOpenGPS(function(res) {
 					console.log('接收', res.code); 
 					if (res.code == -1) {
 						uni.showToast({
 							title: 'Please turn on positioning',
 							icon: 'none'
 						})
 						return
 					}

 					adressAuthority().then(res => {
 						console.log(res);

 						// 判断蓝牙是否打开
 						uni.openBluetoothAdapter({
 							success() {
 								that.deviceSearch();
 							},
 							fail() {
 								uni.showToast({
 									title: 'Bluetooth is off',
 									icon: 'none'
 								})
 								return false
 							},
 						})
 					})
 				});



 			},
 			// 查找设备
 			async deviceSearch() {


 				console.log(this.ble);
 				this.ageinNum = 0;
 				this.rentInitProperty = null;
 				let that = this;

 				if (JSON.stringify(this.selectUser) == '{}') {
 					uni.showToast({
 						title: this.$t('lease.firstMember'),
 						icon: 'none'
 					});
 					return false
 				}
 				if (JSON.stringify(this.actionDevice) == '{}') {
 					uni.showToast({
 						title: this.$t('lease.NoDevicesModel'),
 						icon: 'none'
 					});
 					return false
 				}

 				if (this.leasePrice == '--' || this.leaseDay == '--') {
 					uni.showToast({
 						title: this.$t('lease.NoPriceAvailable'),
 						icon: 'none'
 					});
 					return false
 				}

 				if (this.moneyObj.offMoney - this.leasePrice < 0) {
 					uni.showToast({
 						title: this.$t('lease.InsufficientOffBa'),
 						icon: 'none'
 					});
 					return false
 				}


 				let resL4 = await getlease4(this.actionDevice.productId); //查找这个设备是否租赁了，
 				if (resL4.data.length > 0) {
 					uni.showToast({
 						title: this.$t('lease.DeviceRental'),
 						icon: 'none'
 					});
 					return false
 				}
 				this.ble.init();
 				this.ble.start();
 				uni.showLoading({
 					title: that.$t('lease.Searching'),
 					mask: true
 				})
 				// 搜索设备前，重置mac 和停止发送
 				this.ble.resetMac();
 				// this.ble.stopSendCmd()
 				// 发送读取设备信息
 				this.sendDeviceInfo()

 				// 接收数据
 				this.time = setInterval(() => {

 					that.ble.getBackData(function(res) {
 						console.log(res);
 						// 调试 e485e92 239623826 e486852  E485F04  E485F06  0xe485f05  e486851  e486847  e486852 e485e92 e48684c
						// E48684F e485f04
 						// res.data = [{
 						// 	"mac": "00:00:0E:48:5F:04",
 						// 	// "mac": that.macInp,
 						// 	"name": "null",
 						// 	"msg": "18fffcffffffffffff6f080084000066517c00007b3275870000000000000"
 						// }]
 						if (res.data.length > 0) {

 							let bleDate = res.data[0]
 							let orderNum = parseInt(bleDate.msg.slice(4, 6), 16);
 							let result = repetitionDataMac(res.data, 252, that.actionDevice.productId);
 							if (result) {

 								let obj = mulDataDevice(result.msg) //群回复消息处理
 								if (obj.keys == '6f84667c7b87') { //回复读取设备信息

 									if (that.deviceInfoObj == '') {
 										that.stopSend()
 										uni.showToast({
 											title: result.msg,
 											icon: 'none'
 										})


 										let data111 = obj.orderList[0].data; //充电时间
 										let data132 = obj.orderList[1].data; //充电能量
 										let data102 = obj.orderList[2].data; //电池剩余电量
 										let data124 = obj.orderList[3].data; //剩余时间
 										let data123 = obj.orderList[4].data; //计数器
 										let data135 = obj.orderList[5].data; //健康度

 										that.rentInitProperty = { //设备属性
 											chInter: data111,
 											chargePow: data132,
 											battery: data102,
 											remainTime: data124,
 											counts: data123,
 											healPer: data135,
 										}

 										that.actionDevice.counter = data123
 										if (data135 != 0) {

 											that.reset(that.$t('lease.DeviceBroken'))
 											return false
 										}
 										if (data102 < 50) {

 											that.reset(that.$t('lease.LowBatteryCapacity') + data102 + '%')
 											return false
 										}

 										if (data124 > 120) {

 											that.reset(that.$t('lease.Timer') + parseInt(data124 / 60) + that.$t('lease.hours'))
 											return false
 										}
 										that.battery = data102
 										that.deviceInfoObj = obj
 										uni.hideLoading();
 										that.ble.stopSendCmd();
 										clearTimeout(that.tipsTime);
 										clearInterval(that.time)
 										// 2.1 如果从设备端获取的密码计数器小于APP计数器，发送上一次获取密码。
 										// 2.2 如果从设备端获取的密码计数器等于APP计数器，扣除金额，获取密码。12305
 										// 2.3 如果从设备端获取的密码计数器大于APP计数器，APP计数器将会被更新为设备端获取的密码计数器，扣除金额，获取密码
 										if (data123 < that.actionDevice.counter) { //发送上一次密码 计数器减一
 											that.counterStatus = 'last'

 										} else if (data123 == that.actionDevice.counter) {
 											that.counterStatus = 'next'
 										} else if (data123 > that.actionDevice.counter) {
 											that.actionDevice.counter = data123
 											that.counterStatus = 'next'
 										}
 									}
 								} else {
 									console.log('非租灯信息');
 									that.reset('非租灯信息');

 									uni.hideLoading();
 								}
 							}
 							that.ble.clearData()
 						}
 					})
 				}, 2000)
 			},
 			// 和设备通讯失败的重置
 			reset(t) {
 				this.status = 1
 				clearTimeout(this.tipsTime)
 				clearInterval(this.time)
 				this.stopSend()
 				this.mmObj = ''
 				this.deviceInfoObj = ''
 				this.counterStatus = ''
 				this.battery = '--'
 				this.stepList.map(item => {
 					return item.statusType = 'loading'
 				})
 				// 解锁失败 返还金额
 				// this.alseMoney()
 				if (t) {
 					uni.showToast({
 						title: t,
 						icon: 'none',
 						duration: 5000
 					});
 				}

 			},
 			// 解锁设备失败 返还扣除的钱
 			alseMoney() {

 				// 只处理离线数据
 				this.alseOfflineList()
 				this.$emit('alseMoney', this.leasePrice, 'off')


 				// let isNoNetWork = uni.getStorageSync('isNoNetWork')
 				// console.log(isNoNetWork, '离线状态');
 				// if (isNoNetWork) { //离线
 				// 	this.alseOfflineList()
 				// 	this.$emit('alseMoney', this.leasePrice, 'off')
 				// } else {
 				// 	leaseDeductOnline({
 				// 		amount: this.leasePrice,
 				// 		productId: this.actionDevice.productId,
 				// 		opeCode: 'unlock_fail_back_online'
 				// 	})

 				// 	this.$emit('alseMoney', this.leasePrice, 'on')
 				// }
 			},


 			// 发送相关信息指令
 			sendDeviceInfo() {
 				let {
 					productId
 				} = this.actionDevice
 				let that = this
 				// 发送的命令mac反转,返回的数据不需要反转

 				let deviceMAC = pidToMAC(productId) //产品的PID转为设备MAC地址 转16进制 不足12位，前面0补
 				let deviceMAC16 = formatHexString(deviceMAC) //反转并且加上:
 				console.log(deviceMAC, deviceMAC16);
 				let codeOrder = (251).toString(16)

 				let order1 = '0' + (11).toString(16); //上次充电时间
 				let order2 = (32).toString(16); //上次充电能量
 				let order3 = '0' + (2).toString(16); //电池剩余电量
 				let order4 = (24).toString(16); //剩余时间
 				let order5 = (23).toString(16); //密码计数器
 				let order6 = (35).toString(16); //健康度
 				let code = codeOrder + deviceMAC16 + order1 + order2 + order3 + order4 + order5 + order6

 				let char = addColonEveryTwoChars(deviceMAC)
 				console.log(code, char, order1, order2);

 				this.ble.sendCmd(code, 3, char);
 				// 一秒钟后停止发送
 				setTimeout(() => {
 					that.ble.stopSendCmd()
 				}, 1000)
 				// this.ble.sendCmd(code, 3, '01:02:03:04:05:06')
 				// 3s倒计时
 				this.timePopup();
 			},
 			stopSend() {
 				console.log('停止发送');
 				//停止发送指令和重置过滤条件
 				this.ble.stopSendCmd()
 				// this.ble.resetMac()
 			},


 			// 发送密码给设备
 			sendPass(type) {
 				let that = this
 				let day = this.leaseDay.slice(0, -1)
 				// 计数器本地加一
 				if (type == 'next') {


 					that.actionDevice.counter = (parseInt(that.actionDevice.counter) + 1)
 					// 重置计数器
 					if (that.actionDevice.counter == 50000) {
 						that.actionDevice.counter = 30000
 					}
 					setTimeout(() => {
 						console.log(that.actionDevice);
 						// 重设密码计数器
 						let actionDevice = that.actionDevice
 						delete actionDevice.name
 						addDevice(actionDevice)
 					}, 2000)
 				}

 				let {
 					productId,
 					productSecret,
 					counter
 				} = this.actionDevice

 				let sha = productId.substring(productId.length - 3, productId.length - 2)

 				this.ble.keeloqOutdata(productId, counter, day, productSecret, "0", sha, function(res) {
 					let deviceMAC = pidToMAC(productId)
 					let deviceMAC16 = formatHexString(deviceMAC)
 					let codeOrder = (200).toString(16)
 					let code = codeOrder + deviceMAC16 + res.data

 					let char = addColonEveryTwoChars(deviceMAC);
 					console.log('发送密码', code, counter);
 					that.ble.sendCmd(code, 3, char);

 					let recodePass = {
 						"chargeUnit": "0",
 						"counter": counter,
 						"createTime": getNewYMDHMS(),
 						"days": day,
 						"keycode": res.data,
 						"pid": productId,
 						"rentCode": that.passRentCode,
 						"secKey": productSecret,
 						"sendStatus": "0", //发送成功
 						unlockStatus: "1", //解锁失败，后面状态再更改
 					}
 					addPassConfig(recodePass)

 					// 3s倒计时
 					// that.timePopup()
 					// 一秒后停止发送
 					setTimeout(() => {
 						that.ble.stopSendCmd()
 					}, 1000)
 					that.stepList.map((item, index) => {
 						if (index == 1) {
 							return item.statusType = 'success'
 						}
 					})

 				})
 			},
 			// 扣款
 			leaseHold() {
 				// 只离线扣款
 				this.setOfflineList()

 				this.status++

 				// 		let isNoNetWork = uni.getStorageSync('isNoNetWork')
 				// 		console.log(isNoNetWork, '离线状态');
 				// 		if (isNoNetWork) { //离线状态

 				// 			this.setOfflineList()

 				// 			this.status++

 				// 		} else {
 				// 			console.log(this.leasePrice);
 				// 			// 在线金额扣除
 				// 			leaseDeductOnline({
 				// 				amount: this.leasePrice,
 				// 				productId: this.actionDevice.productId,
 				// 				opeCode: 'unlock_succ_online'
 				// 			}).then(res => {
 				// 				console.log(res);
 				// 				if (res.code == 0) {
 				// 					// 修改home的余额
 				// 					this.$emit('updOffMoney', this.leasePrice, 'on')

 				// 					this.stepList.map((item, index) => {
 				// 						if (index == 0) {
 				// 							return item.statusType = 'success'
 				// 						}
 				// 					})

 				// 					this.status++
 				// 				} else {
 				// 				uni.showToast({
 				// 					title:res.msg,
 				// 					icon:'none'
 				// 				})
 				// 					this.stepList.map((item, index) => {
 				// 						if (index == 0) {
 				// 							return item.statusType = 'error'
 				// 						}
 				// 					})
 				// 				}
 				// 			})
 				// 		}

 			},

 			// 用户信息本地写入
 			async userWrite() {

 				let resL4 = await getlease4(this.actionDevice.productId); //查找这个设备是否租赁了，
 				if (resL4.data.length > 0) {
 					uni.showToast({
 						title: this.$t('lease.DeviceRental'),
 						icon: 'none'
 					});
 					return false
 				}

 				let newDate = new Date().getTime()
 				let newNum = (parseInt(this.selectUser.rentNum) || 0) + 1
 				this.$set(this.selectUser, 'rentNum', newNum);
 				this.$set(this.selectUser, 'lastTimeRent', formatDateTime(newDate));

 				uni.setStorageSync('selectUser', this.selectUser)
 				console.log(this.selectUser);

 				addUser(this.selectUser).then(res => {
 					console.log(res);
 				})

 				// 产品分类 的可租数量 在库数量减一 租赁率
 				// 产品详情的状态改变状态
 				let tenantableNum = 0
 				if (parseInt(this.actionDeviceType.tenantable) > 0) {
 					tenantableNum = parseInt(this.actionDeviceType.tenantable) - 1
 				}
 				let inStoreNum = 0
 				if (parseInt(this.actionDeviceType.inStore) > 0) {
 					inStoreNum = parseInt(this.actionDeviceType.inStore) - 1
 				}
 				this.actionDeviceType.tenantable = tenantableNum.toString()
 				this.actionDeviceType.inStore = inStoreNum.toString()

 				this.actionDevice.stockStatus = '4'
 				delete this.actionDevice.name

 				addDeviceType(this.actionDeviceType)

 				addDevice(this.actionDevice)

 				// 设置过期时间 leaseStatus 添加一条租赁成功的列表 

 				let day = this.leaseDay.slice(0, -1) //因为天数是1d,2d,去掉d
 				let exTime = newDate + (day * 24 * 60 * 60 * 1000)
 				// let exTime = newDate + (2 * 60 * 1000)//调试

 				let leaseData = {
 					customerAccount: this.selectUser.customerAccount,
 					avatar: this.selectUser.avatar,
 					nickname: this.selectUser.nickname,
 					phone: this.selectUser.phone,
 					rentNum: this.selectUser.rentNum,
 					lastTimeRent: this.selectUser.lastTimeRent,
 					photo: this.actionDeviceType.photo,
 					overdueNum: '0',
 					productModel: this.actionDeviceType.productModel,
 					productId: this.actionDevice.productId,
 					counter: this.actionDevice.counter,
 					userAddress: this.selectUser.customerAddress,
 					bondsMan: this.selectUser.guarantorName,
 					bondsManPhone: this.selectUser.guarantorPhone,
 					remind: '0',
 					leaseDay: day,
 					agencySecurityDeposit: this.agencySecurityDeposit,
 					leasePrice: this.leasePrice.toString(),
 					expirationTime: exTime.toString(),
 					nextPopupTime: exTime.toString(),
 					leaseStatus: 4,
 					history: 'null',
 					overdueDay: '0',
 					leaseId: newDate.toString(),
 					rentCode: getrentCode(),
 					rentDtos: JSON.stringify({
 						createTime: getNewYMDHMS(),
 						rentInitProperty: this.rentInitProperty
 					}),
 					backDtos: 'null',
 					overTime: 'null',
 					currProp: JSON.stringify(this.rentInitProperty),
 					iSync: 0, //未同步

 				}
 				console.log(leaseData);
 				addLease(leaseData).then(res => {
 					console.log(res);
 					this.status = 4
 					// 更新产品推荐的 设备 和可租的数量

 					this.$emit('updateDeviceType');
					

 					// 用户写入
 					this.stepList.map((item, index) => {
 						item.statusType = 'success'
 					})


 				})




 			},
 			goBack() {
 				this.showPage = true
 			},
 			// 返还本地离线数据 金额
 			alseOfflineList() {
 				let offlineAmountAll = parseInt(this.moneyObj.offMoney) + parseInt(this.leasePrice)
 				let turnoverAmountAll = this.moneyObj.offMoney - this.leasePrice

 				let tradeCode = "RT" + getNewYMDSql() + createNonceStr()
 				// 离线金额的数据
 				let offList = {
 					tradeCode: tradeCode,
 					offlineAmountOpe: this.leasePrice,
 					onlineAmountAll: this.moneyObj.onMoney,
 					offlineAmountAll: offlineAmountAll,
 					opeCode: 'unlock_fail_back_offline',
 					productId: this.actionDevice.productId,
 					createDate: getNewYMD(),
 					createTime: getNewYMDHMS()
 				}
 				// 营业额
 				let trunOver = {
 					"createDate": getNewYMD(),
 					"createTime": getNewYMDHMS(),
 					"offlineAmountAll": offlineAmountAll,
 					"onlineAmountAll": this.moneyObj.onMoney,
 					"opeCode": "unlock_fail_back_offline",
 					"productId": this.actionDevice.productId,
 					"tradeCode": tradeCode,
 					"turnoverAmountAll": turnoverAmountAll,
 					"turnoverAmountOpe": '-' + this.leasePrice
 				}
 				// 收入
 				let inCome = {
 					"createDate": getNewYMD(),
 					"createTime": getNewYMDHMS(),
 					"incomeAmountAll": this.moneyObj.amountIncome,
 					"incomeAmountOpe": '-' + (this.leasePrice * (this.commission / 100)),
 					"offlineAmountAll": offlineAmountAll,
 					"onlineAmountAll": this.moneyObj.onMoney,
 					"opeCode": "unlock_fail_back_offline",
 					"productId": this.actionDevice.productId,
 					"tradeCode": tradeCode
 				}
 				addOrUpdateInCome(inCome)
 				addOrUpdateOffMoney(offList)
 				addOrUpdateTrunOver(trunOver)



 			},

 			// 设置本地离线列表 
 			setOfflineList() {

 				let offlineAmountAll = this.moneyObj.offMoney - this.leasePrice
 				let turnoverAmountAll = parseInt(this.moneyObj.amountTurnover) + parseInt(this.leasePrice)
 				let incomeAmountAll = parseInt(this.moneyObj.amountIncome) + parseInt(this.leasePrice * (this.commission / 100))


 				let tradeCode = this.passRentCode
 				// 离线金额的数据
 				let offList = {
 					tradeCode: tradeCode,
 					offlineAmountOpe: '-' + this.leasePrice,
 					onlineAmountAll: this.moneyObj.onMoney,
 					offlineAmountAll: offlineAmountAll,
 					opeCode: 'unlock_succ_offline',
 					productId: this.actionDevice.productId,
 					createDate: getNewYMD(),
 					createTime: getNewYMDHMS()
 				}
 				// 营业额
 				let trunOver = {
 					"createDate": getNewYMD(),
 					"createTime": getNewYMDHMS(),
 					"offlineAmountAll": offlineAmountAll,
 					"onlineAmountAll": this.moneyObj.onMoney,
 					"opeCode": "unlock_succ_offline",
 					"productId": this.actionDevice.productId,
 					"tradeCode": tradeCode,
 					"turnoverAmountAll": turnoverAmountAll,
 					"turnoverAmountOpe": this.leasePrice
 				}
 				// 收入
 				let inCome = {
 					"createDate": getNewYMD(),
 					"createTime": getNewYMDHMS(),
 					"incomeAmountAll": incomeAmountAll,
 					"incomeAmountOpe": this.leasePrice * (this.commission / 100),
 					"offlineAmountAll": offlineAmountAll,
 					"onlineAmountAll": this.moneyObj.onMoney,
 					"opeCode": "unlock_succ_offline",
 					"productId": this.actionDevice.productId,
 					"tradeCode": tradeCode
 				}
 				addOrUpdateInCome(inCome)
 				addOrUpdateOffMoney(offList)
 				addOrUpdateTrunOver(trunOver)

 				this.$emit('updOffMoney', this.leasePrice, 'off', this.commission);
				let that = this
				setTimeout(()=>{
					 that.getUserMoney();
				},1000)
			 
 				this.stepList.map((item, index) => {
 					if (index == 0) {
 						return item.statusType = 'success'
 					}
 				})
 			},



 		},
 		components: {
 			priceList,
 			DialogPopup
 		},
 		watch: {
 			selectDeviceInfo: {
 				handler(newVal, oldVal) {
 					console.log(JSON.stringify(newVal) != "{}");
 					if (JSON.stringify(newVal) != "{}") {
 						setTimeout(async () => {
 							let typeIndex = this.deviceTypeList.findIndex(item => {
 								return item.productModel == newVal.productModel
 							})
 							console.log(this.deviceTypeList, newVal);
 							this.actionDeviceType = this.deviceTypeList[typeIndex]

 							await this.getDevice(this.actionDeviceType.productModel)
 							this.getPrice(this.actionDeviceType.productModel)
 							this.actionDevice = newVal
 							console.log(this.actionDeviceType, this.actionDevice);
 							this.inputDeviceId = this.actionDevice.productId
 						}, 700)
 					}

 				},
 				immediate: true
 			},

 		}
 	}
 </script>

 <style lang="scss" scoped>
 	.lease {
 		padding: 16px;
 		width: 100%;
 		box-sizing: border-box;
 		overflow-y: auto;
 		height: calc(100% - 32px);

 		.memberInfo {
 			width: 100%;
 			height: 174px;
 			border: 1px solid #ccc;
 			box-sizing: border-box;
 			margin-bottom: 6px;
 			display: flex;
 			background-color: #fff;

 			.btnBox {
 				width: 300px;
 			}

 			.memberLeft {
 				width: 94px;
 				height: calc(100% - 16px);
 				margin-top: 8px;
 				border-right: 1px solid #ccc;
 				display: flex;
 				align-items: center;
 				flex-direction: column;
 				justify-content: center;

 				text {
 					margin-top: 8px;
 					color: #101010;
 					font-size: 12px;
 				}
 			}

 			.memberRight {
 				width: calc(100% - 94px);
 				padding: 16px;
 				box-sizing: border-box;
 				font-size: 12px;
 				color: #101010;

 				.memberRight-content {
 					margin-bottom: 8px;

 					.contentKey {
 						display: inline-block;
 						width: 80px;
 					}

 					.content-info {
 						margin-left: 8px;

 					}
 				}
 			}
 		}

 		.deviceInfo {
 			width: 100%;
 			height: 340px;
 			border: 1px solid #ccc;
 			box-sizing: border-box;
 			margin-bottom: 6px;
 			background-color: #fff;

 			.deviceTitle {
 				width: calc(100% - 20px);
 				height: 48px;
 				background-color: #B886F8;
 				margin: 10px auto;
 				border-radius: 8px;
 				display: flex;
 				align-items: center;
 				justify-content: space-evenly;

 				.iconBox {
 					width: 24px;
 					height: 24px;
 					border-radius: 50%;
 					background-color: #fff;

 					text {
 						color: #B886F8;
 						line-height: 24px;
 						text-align: center;
 					}
 				}

 				.title {
 					font-size: 20px;
 					color: #fff;
 				}
 			}

 			.deviceMain {
 				display: flex;

 				.deviceLeft {
 					width: 94px;
 					height: 170px;
 					margin-top: 8px;
 					border-right: 1px solid #ccc;
 					display: flex;
 					align-items: center;
 					flex-direction: column;
 					justify-content: center;
 				}

 				.deviceRight {
 					width: calc(100% - 94px);
 					padding: 8px 16px 0;
 					box-sizing: border-box;
 					font-size: 12px;
 					color: #101010;


 					.deviceRight-content {
 						margin-bottom: 6px;
 						display: flex;
 						align-items: center;

 						.deviceRightT {
 							width: 80px;
 							display: inline-block;
 						}

 						.content-info {
 							width: 120px;
 							margin-left: 8px;
 							display: inline-block;

 							.loadingBox {
 								font-size: 20px;
 								font-weight: 600;
 							}

 							.iconContent {
 								float: right;
 							}

 							.dayBtn {
 								width: 24px;
 								height: 24px;
 								line-height: 24px;
 								text-align: center;
 								border: 1px solid #ccc;
 							}
 						}

 						.discounts {
 							display: inline-block;
 							border-bottom: 1px solid #ccc;
 						}
 					}

 				}
 			}

 			.confir {
 				width: calc(100% - 32px);
 				margin: 0 auto;
 				height: 48px;
 				display: flex;
 				align-items: center;
 				justify-content: space-between;

 				.conBtn1 {
 					width: calc(50% - 8px);

 					.btnText {
 						font-size: 12px;
 					}
 				}
 			}


 		}
 	}
 </style>